#include <iostream>

using namespace std;
using ll=long long;
int main() {
    string str;
    cin >> str;
    int ans = 1;
    ll sum = 0;
    for (int pos=0; pos < str.size()-1; pos++) {
        if(str[pos]=='-')
            continue;

        int num = str[pos] - '0';
        sum = (sum+num * ans)%11;
        ans++;
    }
    
    if (sum % 11 == str[str.size() - 1] - '0' || sum%11==10 && str[str.size()-1]=='X') {
        cout << "Right" << endl;
    } else {
         cout << str.substr(0, str.size() - 1);
         if(sum%11==10)
            cout<<'X';
        else{
            cout<<sum%11;
        }
    }
    return 0;
}
